package com.bdqn.blog.service.impl;

import com.bdqn.blog.entity.Song;
import com.bdqn.blog.mapper.SongMapper;
import com.bdqn.blog.service.SongService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 歌曲 服务实现类
 * </p>
 *
 * @author 阿桐幕
 * @since 2020-10-29
 */
@Service
public class SongServiceImpl extends ServiceImpl<SongMapper, Song> implements SongService {

    @Resource
    SongMapper songMapper;

    /**
     * 查询全部 模糊查询
     *
     * @param name
     */
    @Override
    public List<Song> findSongAllOrByName(String name , Integer id) {
        return songMapper.findSongAllOrByName(name ,id);
    }

    /**
     * 查询全部 可根据歌曲名模糊查询  或者歌单id
     *
     * @param name
     * @param id
     */
    @Override
    public List<Song> findSongAllOrByNameAndid(String name, Integer id) {
        return songMapper.findSongAllOrByNameAndid(name, id);
    }

    /**
     * 查询全部 歌单id
     *
     * @param id
     */
    @Override
    public List<Song> getallByid(Integer id) {
        return songMapper.getallByid(id);
    }
}
